<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%
	String path = request.getContextPath();
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>update</title>
<link rel="stylesheet" type="text/css" href="<%=path%>/css/common.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path%>/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="<%=path%>/themes/icon.css" />
<script type="text/javascript" src="<%=path%>/js/jquery.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="<%=path%>/js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=path%>/js/common.js"></script>
<style scoped="scoped">
.textbox {
	height: 20px;
	margin: 0;
	padding: 0 2px;
	box-sizing: content-box;
}
</style>
<script type="text/javascript">
function update(){
	var validate = $("#form1").form('enableValidation').form('validate');
	if(validate){
		$("#form1").submit();
		waiting();
	}else{
		return;
	}
}
function returnQuery(){
	var form = document.forms[1];
	form.action = "<%=path%>/user/queryUser.do";
	form.submit();
	waiting();
}
</script>
</head>
<body style="background: #FFFFFF">
	<form id="form1" name="form1" method="post" action="<%=path%>/user/updateUser.do">
		<fieldset class="fieldset-self">
		<legend>更新用户信息</legend>
		<table width="100%">
			<tr>
				<td>用户名：</td>
				<td><form:input path="user.userName"
						id="userName" cssClass="easyui-validatebox"
						data-options="required:true,validType:'length[6,20]'"
						missingMessage="用户名必须填写" readonly="true" /></td>
				<td>电子邮件：</td>
				<td><form:input path="user.mail" id="mail"
						cssClass="easyui-validatebox" missingMessage="电子邮件必须填写"
						data-options="required:true,validType:'email'" /></td>
				<td>电话号码：</td>
				<td><form:input path="user.phone" id="phone"
						cssClass="easyui-validatebox"
						data-options="required:false,validType:'mobile'"
						invalidMessage="手机号码格式不正确" /></td>
				<td>用户级别：</td>
				<td>
					<!-- 
					<form:select path="user.userLevel" items="${map }" id="userLevel"
						name="userLevel">
					</form:select>
					--> <form:select path="user.userLevel" id="userLevel"
						cssClass="easyui-combobox" cssStyle="width:150px;"
						data-options="required:true,editable:false">
						<form:options items="${userLevelMap }" />
					</form:select>
				</td>
			</tr>
			<tr>
				<td>姓名：</td>
				<td colspan="7">
					<form:input path="user.trueName" id="trueName" cssClass="easyui-validatebox"
						data-options="required:true" missingMessage="姓名必须填写" /></td>
			</tr>
			<tr>
				<td colspan="8">
					<div align="center">
						<form:hidden path="user.userId" id="userId" />
						<a href="#" class="easyui-linkbutton" icon="icon-save" onclick="update();">保存</a>&nbsp;
						<a href="#" class="easyui-linkbutton" icon="icon-cancel" onclick="returnQuery();">取消</a>&nbsp;
					</div>
				</td>
			</tr>
		</table>
		</fieldset>
	</form>
	<form></form>
</body>

</html>
